<script lang="ts">
	import { pixelRatio } from '$store/g';
	export let imgSrc: string;
	export let img2xSrc: string;
	export let alt: string;
	export let classes: string;
</script>

<div class="hidden min-w-0 m-0">
	<img src={imgSrc} srcset="{img2xSrc} 2x" {alt} loading="eager" />
</div>
<div
	class="{classes}"
	style="background-image: url({$pixelRatio === 1 ? imgSrc : img2xSrc})"
>
	<slot />
</div>
